import Vue from 'vue';
import VueX from 'vuex';
Vue.use(VueX);

export default new VueX.Store({
  state: {
    isCollapse: true,
    navData: JSON.parse(sessionStorage.getItem('navData')) || []
  },
  getters: {},
  mutations: {
    // 展开收起侧导航
    isCollapseFn(state, data) {
      state.isCollapse = data;
    },
    navDataFn(state, data) {
      state.navData = data;
      sessionStorage.setItem('navData', JSON.stringify(data))
    }
  },
  actions: {},
});